<!DOCTYPE html>
<%@page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<%@taglib uri="/tld/authority.tld" prefix="authority" %>
<%@taglib uri="/tld/navigator.tld" prefix="navigator" %>
<%@taglib uri="/tld/pagination.tld" prefix="page" %>

<%--<div class="pageheader">
    <h2>下拉选项值管理</h2>

    <div class="breadcrumb-wrapper">
        <span class="left color-999 font13">您当前的位置：</span>
        <ol class="breadcrumb left">
            <li>参数管理</li>
            <li>下拉选项值管理</li>
        </ol>
    </div>
</div>--%>
<navigator:navigator url="options/query.htm"/>

<div class="contentpanel">

    <div class="panel panel-default">
        <form>

            <input type="hidden" name="start" value="${query.start}">
            <input type="hidden" name="length" value="${query.length}">
            <input type="hidden" name="showType" value="${query.showType}">
            <input type="hidden" name="sortField" value="${query.sortField}">
            <input type="hidden" name="sortType" value="${query.sortType}">

            <div class="row">
                <div class="panel-body panel-body2 border-gray-b">
                    <div class="col-md-6">
                        <div class="form-group before-after-none" style="display:table; width:100%;">
                            <label class="col-sm-2 control-label control-label2">选项名称：</label>
                            <div class="col-sm-6">
                                <div class="select-container select">
                                    <select class="select select-offscreen categoryLv1" name="k">
                                        <option value="">-请选择-</option>
                                        <c:forEach items="${optionsKeyList}" var="item">
                                            <option value="${item.k}" ${item.k == query.k ? 'selected' : ''}>${item.name}</option>
                                        </c:forEach>
                                    </select>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-7">
                        <div class="form-group input-group">

                            <div class="select-container select select-container50 input-group-btn col-dm-3">
                                <select class="select select-offscreen" name="searchKey">
                                    <option value="0" ${query.searchKey == 0 ? 'selected' : ''}>选项值</option>
                                    <option value="1" ${query.searchKey == 1 ? 'selected' : ''}>显示文本</option>
                                </select>
                            </div>
                            <input class="form-control form-control2" type="text" name="searchValue"
                                   value="${query.searchValue}" placeholder="请输入查询关键词"/>
                        </div>
                    </div>
                    <div class="btn-group2 left">
                        <button type="submit" class="btn btn-primary btn-4-query"><i class="icon icon-chaxun"></i>查询
                        </button>
                    </div>
                </div>
            </div>

            <%--<div class="row pt15 condition-4-query" style="display: ${query.showType == 0 ? 'none;' : 'block;'}">
                <div class="panel-body">
                    <div class="col-md-8">
                        <div class="form-group before-after-none" style="display:table; width:100%;">

                        </div>
                    </div>
                </div>
            </div>--%>
        </form>
        <%--<div class="row">
            <div class="shrink ${query.showType == 0 ? '': 'active'}">
                <button type="button" class="shrink-btn btn-default btn-4-toggle">
                    <i class="icon icon-xiala1"></i>
                    <span>${query.showType == 0 ? '展开查询条件': '收起查询条件'}</span>
                </button>
            </div>
        </div>--%>
    </div>


    <div class="panel panel-default">
        <div class="row">
            <div class="panel-body panel-body2  plr20">

                <div class="left">
                    <div class="btn-group left btn-group-none2">
                        <authority:authority url="/options/add">
                            <button type="button" class="btn btn-primary btn-4-add"><i class="icon icon-tianjia"></i>新增
                            </button>
                        </authority:authority>
                    </div>
                </div>

            </div>
        </div>

        <div class="row">
            <div class=" plr20">
                <div class="table-responsive">
                    <table class="table dataTable ">
                        <tbody>
                        <tr>
                            <th width="50">&nbsp;</th>
                            <th><strong>选项名称</strong></th>
                            <th><strong>选项值</strong></th>
                            <th><strong>显示文本</strong></th>
                            <th><strong>操作</strong></th>
                        </tr>
                        <c:forEach items="${paging.items}" var="item" varStatus="status">
                            <tr>
                                <td>${(paging.pageIndex - 1) * paging.pageSize + (status.count)}</td>
                                <td>${item.keyName}</td>
                                <td>${item.val}</td>
                                <td>${item.txt}</td>
                                <td>
                                    <authority:authority url="/options/modify">
                                        <a class="btn-4-modify" data-id="${item.id}">修改</a>
                                    </authority:authority>
                                    <authority:authority url="/options/delete">
                                        <a class="btn-4-delete margin-l-10" data-id="${item.id}">删除</a>
                                    </authority:authority>
                                </td>
                            </tr>
                        </c:forEach>
                        </tbody>
                    </table>
                </div>
                <page:page pageIndex="${paging.pageIndex}" pageSize="${paging.pageSize}" count="${paging.count}"/>
            </div>
        </div>
    </div>

    <script src="js/dictionary/options-List.js"></script>
</div>
